package cn.xpg.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import cn.xpg.dao.IntoproductMapper;
import cn.xpg.entity.Intoproduct;
import cn.xpg.service.IntoproductService;

@Service("intoproductService")
public class IntoproductServiceImpl implements IntoproductService {

	@Resource(name = "intoproductMapper")
	private IntoproductMapper intoproductMapper;

	@Override
	public int addIntoproduct(Intoproduct intoproduct) {
		// TODO Auto-generated method stub
		int count = intoproductMapper.addIntoproduct(intoproduct);
		return count;
	}

	@Override
	public int deleteIntoproduct(int intoproduct_id) {
		// TODO Auto-generated method stub
		int count = intoproductMapper.deleteIntoproduct(intoproduct_id);
		return count;
	}

	@Override
	public List<Intoproduct> getIntoproductList(String product_name, int currentPageNo, int pageSize) {
		// TODO Auto-generated method stub
		List<Intoproduct> list = intoproductMapper.getIntoproductList(product_name, currentPageNo, pageSize);
		return list;
	}

	@Override
	public int getIntoproductCount(String product_name) {
		// TODO Auto-generated method stub
		int count = Integer.valueOf(intoproductMapper.getIntoproductCount(product_name).toString());
		return count;
	}

	@Override
	public Intoproduct getIntoproductId(int intoproduct_id) {
		// TODO Auto-generated method stub
		Intoproduct intoproduct = intoproductMapper.getIntoproductId(intoproduct_id);
		return intoproduct;
	}

	@Override
	public int updateIntoproduct(Intoproduct intoproduct) {
		// TODO Auto-generated method stub
		int count = intoproductMapper.updateIntoproduct(intoproduct);
		return count;
	}

	@Override
	public List<Intoproduct> getIntoproductListTOExcel(String product_name) {
		// TODO Auto-generated method stub
		return intoproductMapper.getIntoproductListTOExcel(product_name);
	}

}
